Imports Spring.Context
Imports Spring.Context.Support

Public Class BaseDominio
    Implements IRepositorio

    Private _id As Nullable(Of Long)
    Public Overridable Property Id() As Nullable(Of Long)
        Get
            Return _id
        End Get
        Set(ByVal value As Nullable(Of Long))
            _id = value
        End Set
    End Property

    Private _repositorio As IRepositorio
    Protected Overridable Property Repositorio() As IRepositorio
        Get
            Return _repositorio
        End Get
        Set(ByVal value As IRepositorio)
            _repositorio = value
        End Set
    End Property

    Public Sub New()
        Console.WriteLine("Injecting")
        Dim _contextoDoSpring As IApplicationContext = ContextRegistry.GetContext()
        Dim _repositorio As IRepositorio

        _repositorio = DirectCast(_contextoDoSpring("Repositorio"), IRepositorio)
        Me.Repositorio = _repositorio

    End Sub

#Region "Classes Injetadas"

Protected Overridable Property UIDao() As IUIDao Implements IRepositorio.UIDao
    Get
        Return Me.Repositorio.UIDao
    End Get
    Set(ByVal value As IUIDao)

    End Set
End Property


Protected Overridable Property ItemUIDao() As IItemUIDao Implements IRepositorio.ItemUIDao
    Get
        Return Me.Repositorio.ItemUIDao
    End Get
    Set(ByVal value As IItemUIDao)

    End Set
End Property


Protected Overridable Property PropriedadeDao() As IPropriedadeDao Implements IRepositorio.PropriedadeDao
    Get
        Return Me.Repositorio.PropriedadeDao
    End Get
    Set(ByVal value As IPropriedadeDao)

    End Set
End Property



Protected Overridable Property ElicitacaoDao() As IElicitacaoDao Implements IRepositorio.ElicitacaoDao
    Get
        Return Me.Repositorio.ElicitacaoDao
    End Get
    Set(ByVal value As IElicitacaoDao)

    End Set
End Property


Protected Overridable Property CodigoDao() As ICodigoDao Implements IRepositorio.CodigoDao
    Get
        Return Me.Repositorio.CodigoDao
    End Get
    Set(ByVal value As ICodigoDao)

    End Set
End Property


#End Region

End Class
